<p><?= $this->Html->link("&laquo; nazad", "/users", array( 'escape' => false ))?></p>
<?= $this->Form->create('User', array('url' => '/users/save', 'enctype'=>'multipart/form-data')) ?>

    <?= $this->Form->hidden('id', array( 'value' => (int)@$data['User']['id'])) ?>

    <p><?= $this->Form->label('name', 'Ime:') ?>
    <?= $this->Form->text('name', array( 'value' => @$data['User']['name'])) ?>
    <?= $this->App->formError('name') ?></p>
    
    <p><?= $this->Form->label('email', 'E-Mail:') ?>
    <?= $this->Form->text('email', array( 'value' => @$data['User']['email'])) ?>
    <?= $this->App->formError('email') ?></p>
    
    <p><? if (@$data['User']['id'] > 0): ?>
        <?= $this->Form->label('password', 'Promenite lozinku:') ?>
        <?= $this->Form->password('password', array('required'=>false)) ?>
        <?= $this->Form->label('password2', 'Lozinka Opet:') ?>
        <?= $this->Form->password('password2', array('required'=>false)) ?>
    <? else: ?>
        <?= $this->Form->label('password', 'Lozinka:') ?>
        <?= $this->Form->password('password') ?>
        <?= $this->Form->label('password2', 'Lozinka Opet:') ?>
        <?= $this->Form->password('password2') ?>
    <? endif ?></p>
    
    <p><?= $this->Form->label('client_id', 'Klijent:') ?>
    <?= $this->Form->select('client_id', $clients, array(
        'value' => @$data['User']['client_id'],
        'empty' => ' ---'
    )) ?></p>
    
    <?= $this->Form->button('Sačuvaj') ?>
<?= $this->Form->end() ?>
